package com.itheima.homework05;
/*
2. 题目二
请按标准格式定义一个“学生类”，它有三个属性：姓名、性别、年龄
请编写测试类，创建两个“学生对象”并为它们的属性赋值，
并能比较两个对象的所有属性值是否完全相等。


 */
public class Student2 {
    private String name;
    private String gender;
    private int age;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student2 student2 = (Student2) o;

        if (age != student2.age) return false;
        if (name != null ? !name.equals(student2.name) : student2.name != null) return false;
        return gender != null ? gender.equals(student2.gender) : student2.gender == null;
    }



    public Student2() {
    }

    public Student2(String name, String gender, int age) {
        this.name = name;
        this.gender = gender;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
